/* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   Module Name          : com.yaodian100.crm.workorder.entity.TerminateCodeType
   Module Description   :

   Date Created      : 2009/12/9
   Original Author   : andy.chuang
   Team              : yaodian100
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   MODIFICATION HISTORY
   ------------------------------------------------------------------------------
   Date Modified       Modified by       Comments
   ------------------------------------------------------------------------------
   ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
package com.yaodian100.crm.workorder.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * @author andy.chuang
 *
 */
@Entity
@Table(name="CRM_TERMINATECODE_TYPE")
public class TerminateCodeType implements Serializable{

    /**
     * 
     */
    private static final long serialVersionUID = -7069367747842598369L;
    private String id;
    private String name;
    private String description;
    private TerminateCodeType parent;
    private List<TerminateCodeType> childs;
    /**
     * @return the parent
     */
    @ManyToOne
    public TerminateCodeType getParent() {
        return parent;
    }
    /**
     * @param parent the parent to set
     */
    public void setParent(TerminateCodeType parent) {
        this.parent = parent;
    }
    /**
     * @return the childs
     */
    @OneToMany(mappedBy="parent", targetEntity=TerminateCodeType.class)
    public List<TerminateCodeType> getChilds() {
        return childs;
    }
    /**
     * @param childs the childs to set
     */
    public void setChilds(List<TerminateCodeType> childs) {
        this.childs = childs;
    }
    /**
     * @return the id
     */
    @Id
    @GeneratedValue(generator="system-uuid")
    @GenericGenerator(name="system-uuid", strategy="uuid")
    @Column(length=32)
    public String getId() {
        return id;
    }
    /**
     * @param id the id to set
     */
    public void setId(String id) {
        this.id = id;
    }
    /**
     * @return the name
     */
    @Column(length=100)
    public String getName() {
        return name;
    }
    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }
    /**
     * @return the description
     */
    @Column(length=255)
    public String getDescription() {
        return description;
    }
    /**
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }
}
